using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class ItemMap : EntityTypeConfiguration<Item>
    {
        public ItemMap()
        {
            // Primary Key
            this.HasKey(t => t.ITEM1);

            // Properties
            this.Property(t => t.ITEM1)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.ITEM_SRH)
                .HasMaxLength(10);

            this.Property(t => t.ITEMMSTR)
                .HasMaxLength(10);

            this.Property(t => t.DESC)
                .IsRequired()
                .HasMaxLength(250);

            this.Property(t => t.VENDOR)
                .HasMaxLength(6);

            this.Property(t => t.KITNO)
                .HasMaxLength(8);

            this.Property(t => t.UPCCODE)
                .HasMaxLength(30);

            this.Property(t => t.SUPBCODE)
                .HasMaxLength(30);

            this.Property(t => t.POSLOC)
                .HasMaxLength(5);

            this.Property(t => t.VENDITEMNO)
                .HasMaxLength(20);

            this.Property(t => t.FORM)
                .HasMaxLength(10);

            this.Property(t => t.DOSE)
                .HasMaxLength(10);

            this.Property(t => t.GENERIC_NM)
                .HasMaxLength(50);

            this.Property(t => t.CODE)
                .HasMaxLength(10);

            this.Property(t => t.CIRTIF_NO)
                .HasMaxLength(12);

            this.Property(t => t.DIAM_COLOR)
                .HasMaxLength(10);

            this.Property(t => t.CLARITY)
                .HasMaxLength(4);

            this.Property(t => t.SHAPE)
                .HasMaxLength(6);

            this.Property(t => t.PERL_COLOR)
                .HasMaxLength(10);

            this.Property(t => t.SIZE)
                .HasMaxLength(10);

            this.Property(t => t.CUSTOMV2)
                .HasMaxLength(30);

            this.Property(t => t.CUSTOMV3)
                .HasMaxLength(30);

            this.Property(t => t.CUSTOMV4)
                .HasMaxLength(30);

            this.Property(t => t.CUSTOMV5)
                .HasMaxLength(30);

            this.Property(t => t.ABCCLASSIF)
                .HasMaxLength(2);

            this.Property(t => t.XYZCLASSIF)
                .HasMaxLength(2);

            this.Property(t => t.UPC1)
                .HasMaxLength(30);

            this.Property(t => t.UPC2)
                .HasMaxLength(30);

            this.Property(t => t.UPC3)
                .HasMaxLength(30);

            this.Property(t => t.UPC4)
                .HasMaxLength(30);

            this.Property(t => t.File_Primary_Key)
                .HasMaxLength(10);

            this.Property(t => t.LastPurchRec)
                .HasMaxLength(7);

            this.Property(t => t.DEFRADRESULT)
                .HasMaxLength(1000);

            this.Property(t => t.ITEMID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(t => t.Modifier)
                .HasMaxLength(50);

            this.Property(t => t.Language)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.RX_GenericName)
                .HasMaxLength(50);

            this.Property(t => t.Bin)
                .HasMaxLength(30);

            this.Property(t => t.TPI_Code)
                .HasMaxLength(20);

            this.Property(t => t.Item_catalogue)
                .HasMaxLength(30);

            this.Property(t => t.Item_Manufacturer)
                .HasMaxLength(50);

            this.Property(t => t.Item_Desc_Arabic)
                .HasMaxLength(250);

            this.Property(t => t.item_Alt)
                .HasMaxLength(10);

            this.Property(t => t.Desc_Alt)
                .HasMaxLength(250);

            // Table & Column Mappings
            this.ToTable("Item");
            this.Property(t => t.ITEM1).HasColumnName("ITEM");
            this.Property(t => t.ITEM_SRH).HasColumnName("ITEM_SRH");
            this.Property(t => t.ITEMMSTR).HasColumnName("ITEMMSTR");
            this.Property(t => t.DESC).HasColumnName("DESC");
            this.Property(t => t.TAXABLE).HasColumnName("TAXABLE");
            this.Property(t => t.CLASS).HasColumnName("CLASS");
            this.Property(t => t.UOFMSALES).HasColumnName("UOFMSALES");
            this.Property(t => t.UOFMORDERS).HasColumnName("UOFMORDERS");
            this.Property(t => t.FACTOR).HasColumnName("FACTOR");
            this.Property(t => t.ONHAND).HasColumnName("ONHAND");
            this.Property(t => t.ONORDER).HasColumnName("ONORDER");
            this.Property(t => t.PHYSICAL).HasColumnName("PHYSICAL");
            this.Property(t => t.VENDOR).HasColumnName("VENDOR");
            this.Property(t => t.VENDISCOUNT).HasColumnName("VENDISCOUNT");
            this.Property(t => t.UNITCOST).HasColumnName("UNITCOST");
            this.Property(t => t.COST).HasColumnName("COST");
            this.Property(t => t.ORDERCOST).HasColumnName("ORDERCOST");
            this.Property(t => t.PRICE).HasColumnName("PRICE");
            this.Property(t => t.INQTY).HasColumnName("INQTY");
            this.Property(t => t.INDATE).HasColumnName("INDATE");
            this.Property(t => t.OUTQTY).HasColumnName("OUTQTY");
            this.Property(t => t.OUTDATE).HasColumnName("OUTDATE");
            this.Property(t => t.ADJQTY).HasColumnName("ADJQTY");
            this.Property(t => t.ADJDATE).HasColumnName("ADJDATE");
            this.Property(t => t.MTD_ISSUE).HasColumnName("MTD_ISSUE");
            this.Property(t => t.MTD_RCPTS).HasColumnName("MTD_RCPTS");
            this.Property(t => t.MTD_ADJ).HasColumnName("MTD_ADJ");
            this.Property(t => t.YTD_ISSUE).HasColumnName("YTD_ISSUE");
            this.Property(t => t.YTD_RCPTS).HasColumnName("YTD_RCPTS");
            this.Property(t => t.YTD_ADJ).HasColumnName("YTD_ADJ");
            this.Property(t => t.MIN).HasColumnName("MIN");
            this.Property(t => t.MAX).HasColumnName("MAX");
            this.Property(t => t.KITNO).HasColumnName("KITNO");
            this.Property(t => t.DEBIT).HasColumnName("DEBIT");
            this.Property(t => t.UPCCODE).HasColumnName("UPCCODE");
            this.Property(t => t.SUPBCODE).HasColumnName("SUPBCODE");
            this.Property(t => t.POSLOC).HasColumnName("POSLOC");
            this.Property(t => t.VENDITEMNO).HasColumnName("VENDITEMNO");
            this.Property(t => t.EXCLUDE).HasColumnName("EXCLUDE");
            this.Property(t => t.COUNTRY).HasColumnName("COUNTRY");
            this.Property(t => t.FORM).HasColumnName("FORM");
            this.Property(t => t.DOSE).HasColumnName("DOSE");
            this.Property(t => t.PACKAGE1).HasColumnName("PACKAGE1");
            this.Property(t => t.PACKAGE2).HasColumnName("PACKAGE2");
            this.Property(t => t.PACKAGE3).HasColumnName("PACKAGE3");
            this.Property(t => t.GENERIC_NM).HasColumnName("GENERIC_NM");
            this.Property(t => t.TYPE).HasColumnName("TYPE");
            this.Property(t => t.CATEGORY).HasColumnName("CATEGORY");
            this.Property(t => t.COMMENTS).HasColumnName("COMMENTS");
            this.Property(t => t.CODE).HasColumnName("CODE");
            this.Property(t => t.K).HasColumnName("K");
            this.Property(t => t.ARE).HasColumnName("ARE");
            this.Property(t => t.L).HasColumnName("L");
            this.Property(t => t.R).HasColumnName("R");
            this.Property(t => t.OR).HasColumnName("OR");
            this.Property(t => t.CARAT).HasColumnName("CARAT");
            this.Property(t => t.BRAND).HasColumnName("BRAND");
            this.Property(t => t.APTY_LOSS).HasColumnName("APTY_LOSS");
            this.Property(t => t.IN_PIECES).HasColumnName("IN_PIECES");
            this.Property(t => t.PCS_TO_GMS).HasColumnName("PCS_TO_GMS");
            this.Property(t => t.PURITY).HasColumnName("PURITY");
            this.Property(t => t.CIRTIF_NO).HasColumnName("CIRTIF_NO");
            this.Property(t => t.DIAM_COLOR).HasColumnName("DIAM_COLOR");
            this.Property(t => t.CLARITY).HasColumnName("CLARITY");
            this.Property(t => t.SHAPE).HasColumnName("SHAPE");
            this.Property(t => t.PERL_COLOR).HasColumnName("PERL_COLOR");
            this.Property(t => t.SIZE).HasColumnName("SIZE");
            this.Property(t => t.MKGSPERGRM).HasColumnName("MKGSPERGRM");
            this.Property(t => t.ONHANDPW).HasColumnName("ONHANDPW");
            this.Property(t => t.ONORDERPW).HasColumnName("ONORDERPW");
            this.Property(t => t.IN_PW).HasColumnName("IN_PW");
            this.Property(t => t.OUT_PW).HasColumnName("OUT_PW");
            this.Property(t => t.ADJ_PW).HasColumnName("ADJ_PW");
            this.Property(t => t.MTDISSUEPW).HasColumnName("MTDISSUEPW");
            this.Property(t => t.MTDRCPTSPW).HasColumnName("MTDRCPTSPW");
            this.Property(t => t.MTD_ADJ_PW).HasColumnName("MTD_ADJ_PW");
            this.Property(t => t.YTDISSUEPW).HasColumnName("YTDISSUEPW");
            this.Property(t => t.YTDRCPTSPW).HasColumnName("YTDRCPTSPW");
            this.Property(t => t.YTD_ADJ_PW).HasColumnName("YTD_ADJ_PW");
            this.Property(t => t.LASTRCOST).HasColumnName("LASTRCOST");
            this.Property(t => t.PHY_DATE).HasColumnName("PHY_DATE");
            this.Property(t => t.PHYSICALPW).HasColumnName("PHYSICALPW");
            this.Property(t => t.CUSTOMV1).HasColumnName("CUSTOMV1");
            this.Property(t => t.CUSTOMV2).HasColumnName("CUSTOMV2");
            this.Property(t => t.CUSTOMV3).HasColumnName("CUSTOMV3");
            this.Property(t => t.CUSTOMV4).HasColumnName("CUSTOMV4");
            this.Property(t => t.CUSTOMV5).HasColumnName("CUSTOMV5");
            this.Property(t => t.BU).HasColumnName("BU");
            this.Property(t => t.CLUSTER).HasColumnName("CLUSTER");
            this.Property(t => t.PRODUCTLINE).HasColumnName("PRODUCTLINE");
            this.Property(t => t.ITEMKIND).HasColumnName("ITEMKIND");
            this.Property(t => t.PROGRAM).HasColumnName("PROGRAM");
            this.Property(t => t.CHECKDIGIT).HasColumnName("CHECKDIGIT");
            this.Property(t => t.GROUPNUMBER).HasColumnName("GROUPNUMBER");
            this.Property(t => t.SUBGROUP).HasColumnName("SUBGROUP");
            this.Property(t => t.ABCCLASSIF).HasColumnName("ABCCLASSIF");
            this.Property(t => t.XYZCLASSIF).HasColumnName("XYZCLASSIF");
            this.Property(t => t.FAMILY).HasColumnName("FAMILY");
            this.Property(t => t.USAGE).HasColumnName("USAGE");
            this.Property(t => t.MODEOFSHIP).HasColumnName("MODEOFSHIP");
            this.Property(t => t.LEADTIME).HasColumnName("LEADTIME");
            this.Property(t => t.INACTIVE).HasColumnName("INACTIVE");
            this.Property(t => t.MINORDERQTY).HasColumnName("MINORDERQTY");
            this.Property(t => t.LASTPURCURR).HasColumnName("LASTPURCURR");
            this.Property(t => t.LASTPURDATE).HasColumnName("LASTPURDATE");
            this.Property(t => t.FOBCOST).HasColumnName("FOBCOST");
            this.Property(t => t.SHIPCOST).HasColumnName("SHIPCOST");
            this.Property(t => t.OPERCOST).HasColumnName("OPERCOST");
            this.Property(t => t.SHIPPERCENT).HasColumnName("SHIPPERCENT");
            this.Property(t => t.OPERPERCENT).HasColumnName("OPERPERCENT");
            this.Property(t => t.COST1).HasColumnName("COST1");
            this.Property(t => t.COST2).HasColumnName("COST2");
            this.Property(t => t.MINRETMARG).HasColumnName("MINRETMARG");
            this.Property(t => t.MINWHOLMARG).HasColumnName("MINWHOLMARG");
            this.Property(t => t.MINRETLPRICE).HasColumnName("MINRETLPRICE");
            this.Property(t => t.MINWHOLLPRICE).HasColumnName("MINWHOLLPRICE");
            this.Property(t => t.MAXRETDISC).HasColumnName("MAXRETDISC");
            this.Property(t => t.MAXWHOLDISC).HasColumnName("MAXWHOLDISC");
            this.Property(t => t.MINRETPRICE).HasColumnName("MINRETPRICE");
            this.Property(t => t.MINWHOLPRICE).HasColumnName("MINWHOLPRICE");
            this.Property(t => t.WHOLPRICE).HasColumnName("WHOLPRICE");
            this.Property(t => t.UNIT1).HasColumnName("UNIT1");
            this.Property(t => t.UNIT2).HasColumnName("UNIT2");
            this.Property(t => t.UNIT3).HasColumnName("UNIT3");
            this.Property(t => t.UNIT4).HasColumnName("UNIT4");
            this.Property(t => t.CONVFACT1).HasColumnName("CONVFACT1");
            this.Property(t => t.CONVFACT2).HasColumnName("CONVFACT2");
            this.Property(t => t.CONVFACT3).HasColumnName("CONVFACT3");
            this.Property(t => t.CONVFACT4).HasColumnName("CONVFACT4");
            this.Property(t => t.PENTYPE1).HasColumnName("PENTYPE1");
            this.Property(t => t.PENTYPE2).HasColumnName("PENTYPE2");
            this.Property(t => t.PENTYPE3).HasColumnName("PENTYPE3");
            this.Property(t => t.PENTYPE4).HasColumnName("PENTYPE4");
            this.Property(t => t.PENALTY1).HasColumnName("PENALTY1");
            this.Property(t => t.PENALTY2).HasColumnName("PENALTY2");
            this.Property(t => t.PENALTY3).HasColumnName("PENALTY3");
            this.Property(t => t.PENALTY4).HasColumnName("PENALTY4");
            this.Property(t => t.UPC1).HasColumnName("UPC1");
            this.Property(t => t.UPC2).HasColumnName("UPC2");
            this.Property(t => t.UPC3).HasColumnName("UPC3");
            this.Property(t => t.UPC4).HasColumnName("UPC4");
            this.Property(t => t.OPENINGCOST).HasColumnName("OPENINGCOST");
            this.Property(t => t.SALECURRENCY).HasColumnName("SALECURRENCY");
            this.Property(t => t.A).HasColumnName("A");
            this.Property(t => t.N).HasColumnName("N");
            this.Property(t => t.KIT).HasColumnName("KIT");
            this.Property(t => t.TEMPBIT).HasColumnName("TEMPBIT");
            this.Property(t => t.SUBCAT_ID).HasColumnName("SUBCAT_ID");
            this.Property(t => t.File_Primary_Key).HasColumnName("File Primary Key");
            this.Property(t => t.Division).HasColumnName("Division");
            this.Property(t => t.LastPurchRec).HasColumnName("LastPurchRec");
            this.Property(t => t.Assembly).HasColumnName("Assembly");
            this.Property(t => t.VAT_ENABLED).HasColumnName("VAT_ENABLED");
            this.Property(t => t.Sales_Peak).HasColumnName("Sales_Peak");
            this.Property(t => t.AMS).HasColumnName("AMS");
            this.Property(t => t.Safety_Stock).HasColumnName("Safety_Stock");
            this.Property(t => t.DEFRADRESULT).HasColumnName("DEFRADRESULT");
            this.Property(t => t.ProductionClass).HasColumnName("ProductionClass");
            this.Property(t => t.DefaultWorker).HasColumnName("DefaultWorker");
            this.Property(t => t.DefaultDuration).HasColumnName("DefaultDuration");
            this.Property(t => t.ItemImage).HasColumnName("ItemImage");
            this.Property(t => t.ITEMID).HasColumnName("ITEMID");
            this.Property(t => t.MasterItem).HasColumnName("MasterItem");
            this.Property(t => t.CreationDate).HasColumnName("CreationDate");
            this.Property(t => t.DentChart).HasColumnName("DentChart");
            this.Property(t => t.QtyPric).HasColumnName("QtyPric");
            this.Property(t => t.thSurf).HasColumnName("thSurf");
            this.Property(t => t.trans_code).HasColumnName("trans_code");
            this.Property(t => t.Default).HasColumnName("Default");
            this.Property(t => t.Modifier).HasColumnName("Modifier");
            this.Property(t => t.ni).HasColumnName("ni");
            this.Property(t => t.user).HasColumnName("user");
            this.Property(t => t.Language).HasColumnName("Language");
            this.Property(t => t.Protected).HasColumnName("Protected");
            this.Property(t => t.Pedo).HasColumnName("Pedo");
            this.Property(t => t.question).HasColumnName("question");
            this.Property(t => t.qtyoh).HasColumnName("qtyoh");
            this.Property(t => t.modi_id).HasColumnName("modi_id");
            this.Property(t => t.prc_id).HasColumnName("prc_id");
            this.Property(t => t.noshow).HasColumnName("noshow");
            this.Property(t => t.labtesttemplate).HasColumnName("labtesttemplate");
            this.Property(t => t.Physicianperc).HasColumnName("Physicianperc");
            this.Property(t => t.operationhasdetail).HasColumnName("operationhasdetail");
            this.Property(t => t.defaultcurrency).HasColumnName("defaultcurrency");
            this.Property(t => t.Frsoperation).HasColumnName("Frsoperation");
            this.Property(t => t.groupid).HasColumnName("groupid");
            this.Property(t => t.UnitCostB1).HasColumnName("UnitCostB1");
            this.Property(t => t.CostB1).HasColumnName("CostB1");
            this.Property(t => t.OpeningCostB1).HasColumnName("OpeningCostB1");
            this.Property(t => t.GuarBillingClass).HasColumnName("GuarBillingClass");
            this.Property(t => t.subtypeno).HasColumnName("subtypeno");
            this.Property(t => t.HiltiType).HasColumnName("HiltiType");
            this.Property(t => t.ba).HasColumnName("ba");
            this.Property(t => t.FOBCOST_CUR).HasColumnName("FOBCOST_CUR");
            this.Property(t => t.FOBCOST_B1).HasColumnName("FOBCOST_B1");
            this.Property(t => t.COST1_CUR).HasColumnName("COST1_CUR");
            this.Property(t => t.COST1_b1).HasColumnName("COST1_b1");
            this.Property(t => t.COST2_CUR).HasColumnName("COST2_CUR");
            this.Property(t => t.COST2_b1).HasColumnName("COST2_b1");
            this.Property(t => t.LabReportOrder).HasColumnName("LabReportOrder");
            this.Property(t => t.DepartmentDiscount).HasColumnName("DepartmentDiscount");
            this.Property(t => t.RX_GenericName).HasColumnName("RX_GenericName");
            this.Property(t => t.RX_Duartion).HasColumnName("RX_Duartion");
            this.Property(t => t.RX_Frequency).HasColumnName("RX_Frequency");
            this.Property(t => t.RX_Instruction).HasColumnName("RX_Instruction");
            this.Property(t => t.RX_DispenseTime).HasColumnName("RX_DispenseTime");
            this.Property(t => t.RX_Form).HasColumnName("RX_Form");
            this.Property(t => t.Bin).HasColumnName("Bin");
            this.Property(t => t.TPI_Code).HasColumnName("TPI_Code");
            this.Property(t => t.Item_TPI).HasColumnName("Item_TPI");
            this.Property(t => t.Item_catalogue).HasColumnName("Item_catalogue");
            this.Property(t => t.Item_Note).HasColumnName("Item_Note");
            this.Property(t => t.Item_ID2).HasColumnName("Item_ID2");
            this.Property(t => t.LastFOBCost_b1).HasColumnName("LastFOBCost_b1");
            this.Property(t => t.LastFOBCost_b2).HasColumnName("LastFOBCost_b2");
            this.Property(t => t.LastFOBCost_Curr).HasColumnName("LastFOBCost_Curr");
            this.Property(t => t.LastCost1_b1).HasColumnName("LastCost1_b1");
            this.Property(t => t.LastCost1_b2).HasColumnName("LastCost1_b2");
            this.Property(t => t.LastCost1_Curr).HasColumnName("LastCost1_Curr");
            this.Property(t => t.LastCost2_b1).HasColumnName("LastCost2_b1");
            this.Property(t => t.LastCost2_b2).HasColumnName("LastCost2_b2");
            this.Property(t => t.LastCost2_Curr).HasColumnName("LastCost2_Curr");
            this.Property(t => t.Item_Manufacturer).HasColumnName("Item_Manufacturer");
            this.Property(t => t.Item_Desc_Arabic).HasColumnName("Item_Desc_Arabic");
            this.Property(t => t.Item_GradeRequired).HasColumnName("Item_GradeRequired");
            this.Property(t => t.item_Alt).HasColumnName("item_Alt");
            this.Property(t => t.Desc_Alt).HasColumnName("Desc_Alt");
            this.Property(t => t.Item_Note_Alt).HasColumnName("Item_Note_Alt");
            this.Property(t => t.Item_DC_CodeToothMapping).HasColumnName("Item_DC_CodeToothMapping");
            this.Property(t => t.Item_DC_HideFromList).HasColumnName("Item_DC_HideFromList");
            this.Property(t => t.Item_PurchaseCurrency).HasColumnName("Item_PurchaseCurrency");
            this.Property(t => t.Item_RetailPrice_In_PUR_CURR).HasColumnName("Item_RetailPrice_In_PUR_CURR");
            this.Property(t => t.Item_WholePrice_In_PUR_CURR).HasColumnName("Item_WholePrice_In_PUR_CURR");
        }
    }
}
